const mongoose = require('mongoose');

//2.创建当前数据库的某个集合的约束对象
const adminScheam = mongoose.Schema({
    adminName: {
        type: String,
        required: true,
        unique: true
    },
    password: {
        type: String,
        required: true
    },
    regTime: {
        type: String,
        required: true
    },
    loginTime: {
        type: String,
        require: true,
        default: "----"
    },
    status: {
        type: Number,
        require: true,
        default: 0
    }
})

//3.根据某个约束对象,去创建某个集合
const adminModel = mongoose.model("adminList",adminScheam)

//把这个集合暴露出去
module.exports = adminModel